<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<link type="text/css" href="plug-in/Validform/css/metrole/tablefrom.css" rel="stylesheet">
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<script type="text/javascript">
    $(function() {
        mallOilCardUseModule.init();
    });
    var mallOilCardUseModule = (function(){
        /*初始化时间查询*/
        var initDate = function(){
            $("input[name='createTime_begin']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});});
            $("input[name='createTime_end']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});});

        }
        var module = {
            init :function(){
                initDate();
            },
            useState : function(value, row, index){
                if(value < 30){
                    return "正常使用";
                }
                if(value > 30){
                    return "超过"+value+"天未使用";
                }
            },
            oilcarddetailexport :function(){
                console.log("export");
                window.location.href = 'mallShopCardruleController.do?oilcarddetailexport&cardNo=${oilCard.cardno}&'+$("#mallOilCardUseListForm").serialize();
            }
        }
        return module;
    })();
</script>
<div class="easyui-layout" fit="true">
    <div region="center" style="padding:0px;border:0px">
        <t:datagrid name="mallOilCardUseList"   title="油卡使用情况" queryMode="group" actionUrl="mallShopCardruleController.do?oilcarduse&cardNo=${oilCard.cardno}" idField="id" fit="true">
            <t:dgCol title="编号" field="id" hidden="true"></t:dgCol>
            <t:dgCol title="油卡卡号" field="cardNo"   width="120"></t:dgCol>
            <t:dgCol title="司机" field="driver"   width="120"></t:dgCol>
            <t:dgCol title="司机电话" field="driverMobile"   width="120"></t:dgCol>
            <t:dgCol title="车辆" field="vehicleNo"   width="120"></t:dgCol>
            <t:dgCol title="订单号" field="orderNo" query="true" width="120"></t:dgCol>
            <t:dgCol title="运单号" field="waybillNumber" query="true"  width="120"></t:dgCol>
            <t:dgCol title="使用时间" field="createTime" query="true" queryMode="group" formatter="yyyy-MM-dd hh:mm:ss"  width="120"></t:dgCol>
            <t:dgCol title="货主" field="consignor"   width="120"></t:dgCol>
            <t:dgCol title="项目组" field="projectName"   width="120"></t:dgCol>
            <t:dgCol title="项目人" field="projectUserName"   width="120"></t:dgCol>
            <t:dgCol title="状态" field="state"   replace="未回收_0,已回收_1,已挂失_3"  width="120"></t:dgCol>
            <t:dgCol title="使用状态" field="lastUseDay"   formatterjs="mallOilCardUseModule.useState"   width="120"></t:dgCol>
            <t:dgToolBar title="导出" icon="icon-add" funname="mallOilCardUseModule.oilcarddetailexport"></t:dgToolBar>
        </t:datagrid>
    </div>
</div>

<div region="east" style="width: 700px;" split="true">
    <div  region="north"  split="true"  class="easyui-panel"  style="padding-top: -100px;height: 10px" fit="true" border="false" id="function-panel">
        <table style="width: 100%" cellpadding="0" cellspacing="1" class="formtable">
                <tr><td colspan="6" style="text-align: center">油卡信息</td></tr>
                <tr>
                    <td align="left">
                        <label class="Validform_label">
                               卡号
                        </label>
                    </td>
                    <td class="value" colspan="5">
                        <span class="">${oilCard.cardno}</span>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <label class="Validform_label">
                            属性状态:
                        </label>
                    </td>
                    <td class="value">
                        <span class="">
                            <c:if test="${oilCard.state ==0}">未回收</c:if>
                            <c:if test="${oilCard.state ==1}">已回收</c:if>
                            <c:if test="${oilCard.state ==3}">已挂失</c:if>
                        </span>
                    </td>
                    <%--<td align="right">
                        <label class="Validform_label">
                            使用状态:
                        </label>
                    </td>
                    <td class="value">
                        <span class="">
                            123
                          &lt;%&ndash;  <c:if test="${oilCard.lastUseDay  <= 30}">正常使用</c:if>
                            <c:if test="${oilCard.lastUseDay  > 30}">超过${oilCard.lastUseDay}天未使用</c:if>&ndash;%&gt;
                        </span>
                    </td>--%>
                </tr>
                    <tr><td colspan="6" style="text-align: center">修改记录</td></tr>
                    <c:forEach var="log" items="${logs}" varStatus="index">
                        <tr>
                            <td align="left">
                                <label class="Validform_label">
                                    操作人:
                                </label>
                            </td>
                            <td class="value">
                                <span class="">${log.baseUser.realName}</span>
                            </td>
                            <td align="left">
                                <label class="Validform_label">
                                    时间:
                                </label>
                            </td>
                            <td class="value">
                                <span class=""><fmt:formatDate value='${log.updatetime}' type="date" pattern="yyyy-MM-dd HH:mm:ss"/></span>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                <label class="Validform_label">
                                    变更记录:
                                </label>
                            </td>
                            <td class="value" colspan="5">
                                <textarea style="width: 400px;height:100px">${index.index + 1}): ${log.logcontent}</textarea>
                            </td>
                        </tr>
                    </c:forEach>
        </table>
    </div>

</div>


